<template>
  <div>
    <t-back-top
      container=".tdesign-starter-layout"
      :visible-height="0"
      style="position: absolute"
      :offset="['24px', '80px']"
    >
      <t-icon name="backtop" size="20px" />
    </t-back-top>
    <t-card :bordered="false">
      <t-space direction="vertical">
        <t-collapse :borderless="true" defaultValue="0">
          <t-collapse-panel value="0" header="比对结果">
            <t-table rowKey="index" :data="data" :columns="columns" bordered> </t-table>
          </t-collapse-panel>
          <t-collapse-panel value="1" header="区块和交易">
            <t-table rowKey="index" :data="data1" :columns="columns" bordered> </t-table>
          </t-collapse-panel>
          <t-collapse-panel value="2" header="硬件配置">
            <t-table :data="data2" :columns="columns2" bordered>
              <template #name2>
                <t-select v-model="host" clearable>
                  <t-option value="1" label="host1">host1</t-option>
                  <t-option value="2" label="host2">host2</t-option>
                </t-select>
              </template>
              <template #name3>
                <t-select v-model="host1" clearable>
                  <t-option value="1" label="服务器1">服务器1</t-option>
                  <t-option value="2" label="服务器2">服务器2</t-option>
                </t-select>
              </template>
            </t-table>
          </t-collapse-panel>
          <t-collapse-panel value="3" header="链配置">
            <t-table :data="data3" :columns="columns3" bordered :showHeader="false"> </t-table>
          </t-collapse-panel>
          <t-collapse-panel value="4" header="测试场景">
            <t-table :expanded-row-keys="true" :data="data4" :columns="columns" bordered> </t-table>
          </t-collapse-panel>
        </t-collapse>
      </t-space>
    </t-card>
  </div>
</template>
<script lang="ts">
export default {
  name: 'covReport',
  data() {
    return {
      data: [
        {
          id: 'TPS',
          request_name: '9090/ms',
          chain_name: '888/ms',
        },
      ],
      data1: [
        {
          id: '客户端',
          name: '发送交易数',
          request_name: '100000',
          chain_name: '1000',
        },
        {
          id: '',
          name: '请求成功数',
          request_name: '8888',
          chain_name: '7777',
        },
        {
          id: '',
          name: '请求成功率',
          request_name: '90%',
          chain_name: '87%',
        },
        {
          id: '服务端',
          name: '接收交易数',
          request_name: '100000',
          chain_name: '10000',
        },
        {
          id: '',
          name: '落块交易数',
          request_name: '8888',
          chain_name: '7777',
        },
        {
          id: '',
          name: '总块高',
          request_name: '11111',
          chain_name: '11222',
        },
        {
          id: '区块大小',
          name: '最大',
          request_name: '30kb',
          chain_name: '30kb',
        },
        {
          id: '',
          name: '最小',
          request_name: '30kb',
          chain_name: '26kb',
        },
        {
          id: '',
          name: '平均',
          request_name: '30kb',
          chain_name: '28kb',
        },
        {
          id: '区块大小',
          name: '最大',
          request_name: '30kb',
          chain_name: '26kb',
        },
        {
          id: '',
          name: '最小',
          request_name: '30kb',
          chain_name: '26kb',
        },
        {
          id: '',
          name: '平均',
          request_name: '30kb',
          chain_name: '28kb',
        },
        {
          id: '出块时间间隔',
          name: '最大',
          request_name: '2.5s',
          chain_name: '2.5s',
        },
        {
          id: '',
          name: '最小',
          request_name: '500ms',
          chain_name: '600ms',
        },
        {
          id: '',
          name: '平均',
          request_name: '1.58s',
          chain_name: '1.58s',
        },
        {
          id: '块交易数',
          name: '最大',
          request_name: '10000',
          chain_name: '10000',
        },
        {
          id: '',
          name: '最小',
          request_name: '8888',
          chain_name: '7777',
        },
        {
          id: '',
          name: '平均',
          request_name: '11111',
          chain_name: '11222',
        },
      ],
      columns: [
        {
          title: '',
          fixed: 'left',
          align: 'left',
          ellipsis: true,
          colKey: 'id',
        },
        {
          title: '',
          fixed: 'left',
          align: 'left',
          ellipsis: true,
          colKey: 'name',
        },
        {
          title: '任务1',
          ellipsis: true,
          colKey: 'request_name',
        },
        {
          title: '任务2',
          ellipsis: true,
          colKey: 'chain_name',
        },
      ],
      host: 'host1',
      host1: '服务器1',
      data2: [
        {
          key1: '共识节点数',
          key2: '3',
          key3: '4',
        },
        {
          key1: '同步节点数',
          key2: '3',
          key3: '4',
        },
        {
          key1: '同步节点数',
          key2: '3',
          key3: '4',
        },
        {
          key1: 'CPU',
          key2: '8  AMD EPYC 7K62 48-Core Processor',
          key3: '8  AMD EPYC 7K62 48-Core Processor',
        },
        {
          key1: 'Mem',
          key2: '16G',
          key3: '16G',
        },
        {
          key1: '磁盘',
          key2: 'HDD 500G',
          key3: 'HDD 500G',
        },
        {
          key1: '带宽',
          key2: '4000M/s',
          key3: '4000M/s',
        },
      ],
      columns2: [
        {
          fixed: 'left',
          align: 'left',
          ellipsis: true,
          colKey: 'key1',
          title: '',
        },
        {
          ellipsis: true,
          colKey: 'key2',
          title: 'name2',
        },
        {
          ellipsis: true,
          colKey: 'key3',
          title: 'name3',
        },
      ],
      data3: [
        {
          key1: '链版本',
          key2: '',
          key3: 'V2.3.1.2',
          key4: 'V2.3.1.1',
        },
        {
          key1: '账户模式',
          key2: '',
          key3: 'pk',
          key4: '7777',
        },
        {
          key1: '加密算法',
          key2: '',
          key3: '国密',
          key4: '非国密',
        },
        {
          key1: '共识算法',
          key2: '',
          key3: 'TBFT',
          key4: 'RAFT',
        },
        {
          key1: '交易池',
          key2: '',
          key3: 'normal',
          key4: 'normal',
        },
        {
          key1: 'gas',
          key2: '',
          key3: '开启',
          key4: '关闭',
        },
        {
          key1: '快步同步',
          key2: '',
          key3: '开启',
          key4: '开启',
        },
        {
          key1: '共识节点数',
          key2: '',
          key3: '20',
          key4: '4',
        },
        {
          key1: '同步节点数',
          key2: '',
          key3: '0',
          key4: '0',
        },
        {
          key1: 'core',
          key2: 'tx_scheduler_timeout',
          key3: '200',
          key4: '200',
        },
        {
          key1: '',
          key2: 'xx',
          key3: '',
          key4: '',
        },
        {
          key1: '',
          key2: 'xx',
          key3: '',
          key4: '',
        },
        {
          key1: 'Block',
          key2: 'tx_timestamp_verify',
          key3: 'true',
          key4: 'true',
        },
        {
          key1: '',
          key2: 'xx',
          key3: '8888',
          key4: '7777',
        },
        {
          key1: '',
          key2: 'xx',
          key3: '11111',
          key4: '11222',
        },
      ],
      columns3: [
        {
          fixed: 'left',
          align: 'left',
          ellipsis: true,
          colKey: 'key1',
          title: 'name1',
        },
        {
          ellipsis: true,
          colKey: 'key2',
          title: 'name2',
        },
        {
          ellipsis: true,
          colKey: 'key3',
          title: 'name3',
        },
        {
          align: 'left',
          ellipsis: true,
          colKey: 'key4',
          title: 'name4',
        },
      ],
      data4: [
        {
          id: '并发线程',
          name: '',
          request_name: '10000',
          chain_name: '10000',
        },
        {
          id: '请求时间',
          name: '',
          request_name: '20ms',
          chain_name: '30ms',
        },
        {
          id: '循环次数',
          name: '',
          request_name: '10',
          chain_name: '10',
        },
        {
          id: '运行时间',
          name: '',
          request_name: '',
          chain_name: '',
        },
        {
          id: '启动方式',
          name: '',
          request_name: '每10ms启动10个线程',
          chain_name: '每10ms启动10个线程',
        },
        {
          id: '请求',
          name: '合约类型',
          request_name: 'go',
          chain_name: 'go',
        },
        {
          id: '',
          name: '合约名',
          request_name: 'save',
          chain_name: 'save',
        },
        {
          id: '',
          name: '方法',
          request_name: 'save',
          chain_name: 'save',
        },
        {
          id: '',
          name: '参数',
          request_name: `{
            {
              "id":"id_0_0_{random,20}“,
              "hash”:”h_0_0_{random,20}”,
              "metadata":{
                  "hashType":"file",
                  "hashAlgorithm”:”hash_{env1}”,
                  "username":"taifu",
                  "timestamp":"1672048892",
                  "proveTimestamp":""
              }
            }`,
          chain_name: `{
            {
              "id":"id_0_0_{random,20}“,
              "hash”:”h_0_0_{random,20}”,
              "metadata":{
                  "hashType":"file",
                  "hashAlgorithm”:”hash_{env1}”,
                  "username":"taifu",
                  "timestamp":"1672048892",
                  "proveTimestamp":""
              }
            }`,
        },
        {
          id: '超时时间',
          name: '',
          request_name: '200ms',
          chain_name: '200ms',
        },
      ],
    };
  },
};
</script>

<style scoped lang="less"></style>
·
